#!/bin/bash

export MESOS_NATIVE_JAVA_LIBRARY=/usr/local/mesos/build/src/.libs/libmesos.so

log_dir=/var/log/marathon
if [ ! -d $log_dir ]; then
	mkdir -p $log_dir
fi

 cur_process_id=$(ps -ef|grep marathon-assembly|grep -v grep |awk '{print $2}' )
 if [ "x${cur_process_id}" != "x" ] ; then
     echo "current pid of marathon: $cur_process_id kill it"
     kill -9 $cur_process_id
 fi

/usr/local/marathon/bin/start --master zk://192.168.3.7:2181,192.168.1.118:2181,192.168.3.117:2181/mesos2 \
	--hostname `hostname` \
	--zk zk://192.168.3.7:2181,192.168.1.118:2181,192.168.3.117:2181/marathon2 >> $log_dir/marathon.out 2>&1 &
